<html>
<head>
	<meta charset="UTF-8">
	<meta content="IE=edge" http-equiv="X-UA-Compatible">
	<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" name="viewport">
	<title>4529：[Bjoi2014]想法</title>
	<!-- css -->
	<link href="../css/base.min.css" rel="stylesheet">
	<link href="../css/project.min.css" rel="stylesheet">
	
	<!-- favicon -->
	<!-- ... -->
</head>
<body class="page-brand">
	<header class="header header-transparent header-waterfall ui-header">
		<ul class="nav nav-list pull-left">
			<li>
				<a data-toggle="menu" href="#menu">
					<span class="icon icon-lg">menu</span>
				</a>
			</li>
		</ul>
		<a class="header-logo header-affix-hide margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">[Bjoi2014]想法</a>
		<span class="header-logo header-affix margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">[Bjoi2014]想法</span>
	</header>
	<nav aria-hidden="true" class="menu" id="menu" tabindex="-1">
		<div class="menu-scroll">
			<div class="menu-content">
				<a class="menu-logo" href="../index.html">BZOJ离线题库</a>
				<ul class="nav">
					<li>
						<a class="waves-attach" data-toggle="collapse" href="#problems">题目</a>
						<ul class="menu-collapse collapse in" id="problems">
							<li>
								<a class="waves-attach" href="../index.html">主页</a>
							</li>
							<li>
								<a class="waves-attach" href="../list.html">题目列表</a>
							</li>
						</ul>
					</li>
					<li>
						<a class="collapsed waves-attach" data-toggle="collapse" href="#about">关于</a>
						<ul class="menu-collapse collapse" id="about">
							<li>
								<a class="waves-attach" href="../about.html">关于此项目</a>
							</li>
						</ul>
					</li>
					
				</ul>
			</div>
		</div>
	</nav>
	<main class="content">
		<div class="content-header ui-content-header">
			<div class="container">
				<h1 class="content-heading">
                [Bjoi2014]想法                </h1>
                <p>时间限制：20s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  空间限制：256MB</p>			</div>
		</div>
		<div class="container">
			<section class="content-inner margin-top-no">
				<div class="row">
					<div class="col-lg-13 col-md-13">
						<div class="card margin-bottom-no">
							<div class="card-main">
								<div class="card-inner">
									
                                <h3>题目描述</h3><p><div>小强和阿米巴是好朋友。小强要出一套题目。</div>
<div>他的题目以涉及面广（偏）、考察深入（怪）、思维</div>
<div>强度大（难）著称。他为了出题，一共攒了M个本质不同的想法，每个想法形</div>
<div>成了一个题目。不过，他觉得拿这些题目去考察选手会把比赛搞的太过变态，</div>
<div>所以，想请阿米巴来帮忙调整一下他的题目。</div>
<div>阿米巴指出，为了让一场考试的题目的考察点尽量全面，有一个通用的做</div>
<div>法叫做&ldquo;组合&rdquo;。如果把两个题目A和B组合在一起，那么组合而成的题目涉</div>
<div>及到的想法的集合就是A涉及到的想法的集合和B涉及到的想法的集合的并。</div>
<div>并且，题目是可以反复组合的。</div>
<div>例如，小强现在有三个想法1,2,3，分别对应了题目P1,P2,P3。</div>
<div>现在，小强把P1和P2组合得到P4。P4涉及的想法的集合是{1,2}。</div>
<div>之后，小强把P2和P3组合得到P5。P5涉及的想法的集合是{2,3}。</div>
<div>最后，小强把P4和P5组合得到P6。P6涉及的想法的集合是{1,2,3}。</div>
<div>现在，小强告诉你每个题目都是如何组合而来的。你要回答的就是，每个</div>
<div>题目涉及的想法的集合有多大。</div>
<div>不过，这个问题是很难的。于是，你只需要能够以比较高的概率回答的比较准确即可。</div>
<div></div></p><hr/><h3>输入格式</h3><p><div>第一行两个整数N，M，依次表示小强的题目数量和想法的数量</div>
<div>接下来N-M行，每行两个整数，依次表示小强组合出来的题目都是由哪两</div>
<div>个题组合而成的。M个想法对应的题目依次编号为1~M。之后，小强组合出来</div>
<div>的第一个题编号为M+1，组合出来的第二个题编号为M+2，依次类推。</div>
<div>M&le;100000,N&le;1000000</div>
<div></div></p><hr/><h3>输出格式</h3><p><p>输出N-M行，每行一个整数表示小强组合出来的每个题都涉及了几个想法。</p>
<div></div>
<div></div>
<div></div></p><hr/><h3>样例输入</h3><pre>6 3
1 2
2 3
4 5</pre><hr/><h3>样例输出</h3><pre>2
2
3</pre><hr/><h3>提示</h3><p>没有写明提示</p><hr/><h3>题目来源</h3><p>鸣谢佚名上传</p>
								</div>
							</div>
						</div>
					</div>
				</div>
				
				
			</section>
		</div>
	</main>

	<div class="fbtn-container">
		<div class="fbtn-inner">
			<a class="fbtn fbtn-lg fbtn-brand-accent waves-attach waves-circle waves-light waves-effect" data-toggle="dropdown" aria-expanded="true"><span class="fbtn-text fbtn-text-left">Menu</span><span class="fbtn-ori icon">apps</span><span class="fbtn-sub icon">close</span></a>
			<div class="fbtn-dropup">
				<a class="fbtn fbtn-brand waves-attach waves-circle waves-light waves-effect" href="../list.html" target="_self"><span class="fbtn-text fbtn-text-left">题目列表</span><span class="icon">menu</span></a>
				<a class="fbtn fbtn-green waves-attach waves-circle waves-effect" href="../index.html" target="_self"><span class="fbtn-text fbtn-text-left">返回主页</span><span class="icon">home</span></a>
				<a class="fbtn waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/submitpage.php?id=4529" target="_blank"><span class="fbtn-text fbtn-text-left">提交代码</span><span class="icon">send</span></a>
				<a class="fbtn fbtn-orange waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/wttl/wttl.php?pid=4529" target="_blank"><span class="fbtn-text fbtn-text-left">试题讨论</span><span class="icon">chat</span></a>
				
			</div>
		</div>
	</div>

	<!-- js -->
	<script src="../js/jquery.min.js"></script>
	<script src="../js/base.min.js"></script>
	<script src="../js/project.min.js"></script>
</body>
</html>